 <?php 
 
 if(isset($com)){
 //var_dump($com);?> 
 <div id="title_right">
            		<p id="title_right_left"></p>
            		<div id="title_right_center">
            		  <p class="chu_title">BÌNH LUẬN VỀ SẢN PHẨM</p>
            		</div>
           			<p id="title_right_right"></p>
             	</div> 
<?php 
if(is_array($com['list'])){
foreach ($com['list'] as $key =>$item){?>
             	<table class="table3">
         
         		<tr>
         		<td>Họ tên:</td>
         		<td><?php echo $item['HoTen'];?></td>
         		</tr>
         		<tr>
         		<td>Email:</td>
         		<td><?php echo $item['Email'];?></td>
          		</tr>
          		<tr>
          		<td>Nội dung:</td>
          		<td><?php echo $item['NoiDung'];?></td>
          		</tr>
          		<tr>
          		<td>Thời gian:</td>
          		<td><?php echo $item['ThoiGian'];?></td>
          		</tr>
         	
             	</table>  
             	             	
  <?php }}?>
  <div align="center">
 <a href="index.php?mod=addcom&id=<?php echo $_GET['id'];?>" ><img src="public/hinhanh/binhluan.jpg" height="27px" width= "83px"/></a>
 </div>
 <?php }
  elseif(!isset($_SESSION['username'])){?>
  <script type="text/javascript" src="public/jquery-validate/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="public/jquery-validate/jquery.validate.min.js"></script>
	<script type="text/javascript" src="public/jquery-validate/localization/messages_vi.js"></script>
	<script type="text/javascript">
		$(document).ready(function(){
			$("#contact").validate({
				errorElement: "span", //Thành phần HTML hiện thông báo lỗi
				//Sử dụng tùy chọn rules cho những validate không hỗ trợ bởi class name
				rules: {
					nlmk: {
						equalTo: "#password" //So sánh với trường cpassword với thành trường có id là password
					},
					cemail: {
						equalTo: "#email" //So sánh với trường cemail với thành trường có id là email
					},
					<?php
					echo $_SESSION['security_code'];?>:{
						equalTo: "#txtCaptcha" 
					},
					min_field: { min: 5 }, //Giá trị tối thiểu
					max_field: { max : 10 }, //Giá trị tối đa
					range_field: { range: [4,10] }, //Giá trị trong khoảng từ 4 - 10
					rangelength_field: { rangelength: [4,10] } //Chiều dài chuỗi trong khoảng từ 4 - 10 ký tự
				}
			});
		});
	</script>
  <div id="title_right">
            		<p id="title_right_left"></p>
            		<div id="title_right_center">
            		  <p class="chu_title">VIẾT BÌNH LUẬN VỀ SẢN PHẨM</p>
            		</div>
           			<p id="title_right_right"></p>
             	</div> 
         <form id="contact" method="post" action="" enctype="multipart/form-data" class="contact-form" >
                 	<table class="table3">
         		<tr>
         		<td>Họ tên<span class="rq"> * </span></td>
         		<td><input name="hoten" type="text" id="txthovaten"
							class="required" tabindex="5" style="background:#FFF" /></td>
         		</tr>
         		<tr>
         		<td>Email<span class="rq"> * </span></td>
         		<td><input class="required email" id="email" name="txtmail" type="text" class="text" tabindex="4" style="background:#FFF" /></td>
          		</tr>
          		<td>Điện thoại:</td>
         		<td><input name="dienthoai" type="text" class="number" tabindex="4" style="background:#FFF" /></td>
          		</tr>
          		<tr>
          		<td>Nội dung<span class="rq"> * </span>:</td>
          		<td><textarea name="noidung" cols="20" rows="5" id="txtdiachi"
							class="required" style="background:#FFF"></textarea></td>
          		</tr>
          		
          		<tr>
					<td>Mã bảo vệ<span class="rq"> * </span></td>
					<td>
					<img src="public/hinhanh/capcha.php" />
					</td>
				</tr>
				<tr>
					<td>Nhập mã bảo vệ<span class="rq"> * </span>:</td> 
					<td><input type="text" name="txtCaptcha" maxlength="10"
						size="20" class="required" style="background:#FFF"/>
					</td>
					</tr>
					<tr>
          		<tr>
				
					<td align="center" colspan="2">
                    <input name="dangky" type="submit" value="" class="btTxt submit" style="background: url('public/hinhanh/binhluan.jpg');height: 27px;width: 83px"/>
                    <input name="" type="reset" id="" value="" style="background: url('public/hinhanh/lamlai.jpg');height: 28px;width: 83px" />
					</td>

				</tr>
          		</tr>
         		
             	</table>  
             	</form>  
<?php }else{
if(isset($user)){
?>
  <div id="title_right">
            		<p id="title_right_left"></p>
            		<div id="title_right_center">
            		  <p class="chu_title">VIẾT BÌNH LUẬN VỀ SẢN PHẨM</p>
            		</div>
           			<p id="title_right_right"></p>
             	</div> 
         <form id="contact" method="post" action="" enctype="multipart/form-data" class="contact-form" >
                 	<table class="table2">
         		<tr>
         		<td width="200px">Họ tên<span class="rq"> * </span></td>
         		<td><input name="hoten" type="text" id="txthovaten"
							class="required" tabindex="5"  value="<?php echo $user['HoTen'];?>" size=35 disabled="disabled" /></td>
         		</tr>
         		<tr>
         		<td>Email<span class="rq"> * </span></td>
         		<td><input class="required email" id="email" name="txtmail" type="text" class="text" tabindex="4"  value="<?php echo $user['Email'];?>" size=35 disabled="disabled" /></td>
          		</tr>
          		<td>Điện thoại:</td>
         		<td><input name="dienthoai" type="text" class="number" tabindex="4"  value="<?php echo $user['DienThoai'];?>" size=35 disabled="disabled" /></td>
          		</tr>
          		<tr>
          		<td>Nội dung<span class="rq"> * </span>:</td>
          		<td><textarea name="noidung" cols="20" rows="5" id="txtdiachi"
							class="required" style="background:#FFF"></textarea></td>
          		</tr>
          		
          		<tr>
					<td>Mã bảo vệ<span class="rq"> * </span></td>
					<td>
					<img src="public/hinhanh/capcha.php" />
					</td>
				</tr>
				<tr>
					<td>Nhập mã bảo vệ<span class="rq"> * </span>:</td> 
					<td><input type="text" name="txtCaptcha" maxlength="10"
						size="20" class="required" style="background:#FFF"/>
					</td>
					</tr>
					<tr>
          		<tr>
				
					<td align="center" colspan="2">
                    <input name="dangky" type="submit" value="" class="btTxt submit" style="background: url('public/hinhanh/binhluan.jpg');height: 27px;width: 83px"/>
                    <input name="" type="reset" id="" value="" style="background: url('public/hinhanh/lamlai.jpg');height: 28px;width: 83px" />
					</td>

				</tr>
          		</tr>
         		
             	</table>  
             	</form>  
	
<?php   }}?>